package com.itheima.api.hashset.demo05;

import java.util.HashSet;

public class HashSetDemo01 {

    public static void main(String[] args) {

        Student s1 = new Student("zhangsan", 23);
        Student s2 = new Student("lisi", 18);
        Student s3 = new Student("wangwu", 20);
        Student s4 = new Student("wangwu", 20);

        HashSet<Student> hashSet = new HashSet<Student>();
        hashSet.add(s1);
        hashSet.add(s2);
        hashSet.add(s3);
        hashSet.add(s4);

        hashSet.forEach(s -> System.out.println(s));

    }

}
